package com.lc1993929.mr.join;

import lombok.Data;
import org.apache.hadoop.io.Writable;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

/**
 * Created by LiuChang on 2017/12/14/014.
 */
@Data
public class JoinBean implements Writable {
    private String orderid;
    private String uid;
    private String uname;
    private String age;
    private String lover;
    private String tableName;

    @Override
    public void write(DataOutput dataOutput) throws IOException {
        dataOutput.writeUTF(this.orderid);
        dataOutput.writeUTF(this.uid);
        dataOutput.writeUTF(this.uname);
        dataOutput.writeUTF(this.age);
        dataOutput.writeUTF(this.lover);
        dataOutput.writeUTF(this.tableName);
    }

    @Override
    public void readFields(DataInput dataInput) throws IOException {
        this.orderid = dataInput.readUTF();
        this.uid = dataInput.readUTF();
        this.uname = dataInput.readUTF();
        this.age = dataInput.readUTF();
        this.lover = dataInput.readUTF();
        this.tableName = dataInput.readUTF();
    }
}
